Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unexpected special replacement pattern #293

Merged
merged 6 commits into from
Dec 15, 2024

Conversation

lawvs
Copy link
Contributor

@lawvs lawvs commented Dec 13, 2024

@WebReflection
Copy link
Owner

How bizarre… I completely forgot about it, nice catch but split join feels unnecessarily expensive? Although I’m not sure doubling $ in text content would be faster or better, have you tried that? 🤔 all $\S should become $$\S

@WebReflection
Copy link
Owner

Another way could be using a one-off arrow that should not have special meanings 🤔

@lawvs
Copy link
Contributor Author

lawvs commented Dec 14, 2024

Another way could be using a one-off arrow that should not have special meanings 🤔

I created a simple bench, and the results show that replace indeed has better performance without using regex.

image

@lawvs lawvs requested a review from WebReflection December 15, 2024 08:52
@WebReflection WebReflection merged commit 5216400 into WebReflection:main Dec 15, 2024
2 checks passed
@WebReflection
Copy link
Owner

It's up and running (or better, published)

@lawvs lawvs deleted the fix/replace branch December 15, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected characters $$ were escaped in scripts
2 participants